Allow testing optional dependencies
authorAlex Crichton <alex@alexcrichton.com>
Wed, 21 Oct 2015 00:19:56 +0000 (17:19 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 21 Oct 2015 00:22:18 +0000 (17:22 -0700)
commit3332c91f983af579d56f36d6413ec0758122def8
treea081bba3324e86687e88f7c43576b430cf48fac1
parentfd4c5548782ea34cbee8943d0565dbc20a4e1dcb
Allow testing optional dependencies

Previously a warning was issued if both -p and --features were passed as flags,
and the rationale for this was that if --features modified the activated set of
features in the package selected by -p it would alter Cargo.lock, which is
undesirable as Cargo.lock should be stable.

This commit, however, interprets --features as changing the resolved graph of
the top-level package, and then -p is a query on that resolved graph. This way
the Cargo.lock file never changes and you're allowed to test optional
dependencies.
src/cargo/ops/cargo_compile.rs
tests/test_cargo_test.rs